/*
using MyGeneration/Template/NHibernate (c) by lujan99@usa.net
*/
using System;
using System.Collections;
using System.Collections.Generic;

namespace OpenGado.DATA.Entities
{
	/// <summary>
	/// PurchaseOrders object for NHibernate mapped table 'purchase_orders'.
	/// </summary>
	[Serializable]
	public class PurchaseOrders
	{
		#region Member Variables
		protected int _purchaseorderid;
		protected string _purchaseordernum;
		protected DateTime? _podate;
		protected string _postatus;
		protected string _poremarks;
		protected Vendor _vendor;
		protected string _poinitiatedby;
		protected DateTime _potimestamp;
		protected string _potype;
		protected string _paymentmethod;
		protected IList<PurchaseOrderItems> _purchaseorderitems;
		#endregion
		#region Constructors
			
		public PurchaseOrders() {}
					
		public PurchaseOrders(string purchaseordernum, DateTime? podate, string postatus, string poremarks, Vendor vendor, string poinitiatedby, DateTime potimestamp, string potype, string paymentmethod) 
		{
			this._purchaseordernum= purchaseordernum;
			this._podate= podate;
			this._postatus= postatus;
			this._poremarks= poremarks;
			this._vendor= vendor;
			this._poinitiatedby= poinitiatedby;
			this._potimestamp= potimestamp;
			this._potype= potype;
			this._paymentmethod= paymentmethod;
		}

		public PurchaseOrders(Vendor vendor)
		{
			this._vendor= vendor;
		}
		
		#endregion
		#region Public Properties
		public int PurchaseOrderId
		{
			get { return _purchaseorderid; }
			set {_purchaseorderid= value; }
		}
		public string PurchaseOrderNum
		{
			get { return _purchaseordernum; }
			set {_purchaseordernum= value; }
		}
		public DateTime? PoDate
		{
			get { return _podate; }
			set {_podate= value; }
		}
		public string PoStatus
		{
			get { return _postatus; }
			set {_postatus= value; }
		}
		public string PoRemarks
		{
			get { return _poremarks; }
			set {_poremarks= value; }
		}
		public Vendor Vendor
		{
			get { return _vendor; }
			set {_vendor= value; }
		}
		public string PoInitiatedBy
		{
			get { return _poinitiatedby; }
			set {_poinitiatedby= value; }
		}
		public DateTime PoTimestamp
		{
			get { return _potimestamp; }
			set {_potimestamp= value; }
		}
		public string PoType
		{
			get { return _potype; }
			set {_potype= value; }
		}
		public string Paymentmethod
		{
			get { return _paymentmethod; }
			set {_paymentmethod= value; }
		}
		public IList<PurchaseOrderItems> PurchaseOrderItems
		{
			get { return _purchaseorderitems; }
			set {_purchaseorderitems= value; }
		}
		#endregion
		
		#region Equals And HashCode Overrides
		/// <summary>
		/// local implementation of Equals based on unique value members
		/// </summary>
		public override bool Equals( object obj )
		{
			if( this == obj ) return true;
			if( ( obj == null ) || ( obj.GetType() != this.GetType() ) ) return false;
			PurchaseOrders castObj = (PurchaseOrders)obj;
			return ( castObj != null ) &&
			this._purchaseorderid == castObj.PurchaseOrderId;
		}
		/// <summary>
		/// local implementation of GetHashCode based on unique value members
		/// </summary>
		public override int GetHashCode()
		{
			int hash = 57;
			hash = 27 * hash * _purchaseorderid.GetHashCode();
			return hash;
		}
		#endregion
		
	}
}
